package gui;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.UIManager;
import javax.swing.JButton;

import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
/**
 * 
 * @author Idan Mann
 * This GUI class is an optional extension to the View Request GUI.
 * It presents a simple scrollable text box in a window seperate to the request view
 *
 */
public class RemarksFrame extends JFrame
{
	private JFrame me;
	private JTextArea remarksArea;
	
	public RemarksFrame(String remarks)
{
		this.me = this;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		getContentPane().setLayout(null);
		
		JLabel lblRemarks = new JLabel("Remarks");
		lblRemarks.setBounds(10, 28, 114, 14);
		getContentPane().add(lblRemarks);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(20, 53, 639, 93);
		getContentPane().add(scrollPane);
		
		remarksArea = new JTextArea();
		remarksArea.setBackground(UIManager.getColor("TextArea.disabledBackground"));
		remarksArea.setEditable(false);
		scrollPane.setViewportView(remarksArea);
		
		JButton btnClose = new JButton("Close");
		btnClose.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				me.setVisible(false);
			}
		});
		btnClose.setBounds(294, 171, 91, 23);
		getContentPane().add(btnClose);
		
		remarksArea.setText(remarks);
	}
	
	


}
